<template>
    <div>
        <Modal v-model="modal.search" title="高级搜索" width="1020">
            <Form ref="searchForm" :model="searchForm" :label-width="120">
                <Row>
	<i-col span="12">
	<FormItem label="账目编号"><Row>
	<i-col span="11">
	<FormItem prop="idMin">
	<InputNumber v-model="searchForm.idMin" placeholder="请输入开始账目编号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="idMax">
	<InputNumber v-model="searchForm.idMax" placeholder="请输入结束账目编号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="交易编号" prop="transactionNo">
	<Input v-model="searchForm.transactionNo" placeholder="请输入交易编号" clearable/>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="用户编号"><Row>
	<i-col span="11">
	<FormItem prop="userIdMin">
	<InputNumber v-model="searchForm.userIdMin" placeholder="请输入开始用户编号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="userIdMax">
	<InputNumber v-model="searchForm.userIdMax" placeholder="请输入结束用户编号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="金额（元）"><Row>
	<i-col span="11">
	<FormItem prop="amountMin">
	<InputNumber v-model="searchForm.amountMin" placeholder="请输入开始金额（元）" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="amountMax">
	<InputNumber v-model="searchForm.amountMax" placeholder="请输入结束金额（元）" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="积分"><Row>
	<i-col span="11">
	<FormItem prop="integralMin">
	<InputNumber v-model="searchForm.integralMin" placeholder="请输入开始积分" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="integralMax">
	<InputNumber v-model="searchForm.integralMax" placeholder="请输入结束积分" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
<FormItem label="收入或支出" prop="type">
		
        <Select v-model="searchForm.type" placeholder="账目状态" filterable clearable>
          <Option
            v-for="(option, index) in INCOME_OUTGOING_TYPE_Select"
            :value="option.value"
            :key="index"
          >{{option.displayValue}}</Option>
        </Select>
    
</FormItem>
	
</i-col>

	<i-col span="12">
	<FormItem label="收支类型" prop="subType">
	    
	        <Select v-model="searchForm.subType" placeholder="收支类型" filterable clearable>
	          <Option
	            v-for="(option, index) in subTypeSelect"
	            :value="option.value"
	            :key="index"
	          >{{option.displayValue}}</Option>
	        </Select>
	    
	</FormItem>
</i-col><i-col span="12">
<FormItem label="支付方式" prop="payType">
    
        <Select v-model="searchForm.payType" placeholder="支付方式" filterable clearable>
          <Option
            v-for="(option, index) in PAYMENT_TYPE_Select"
            :value="option.value"
            :key="index"
          >{{option.displayValue}}</Option>
        </Select>
    
</FormItem>
	
</i-col>

	<i-col span="12">
	<FormItem label="账目备注" prop="remark">
	<Input v-model="searchForm.remark" placeholder="请输入账目备注" clearable/>
</FormItem>
</i-col><i-col span="12">
<FormItem label="账目状态" prop="accountStatus">
    
        <Select v-model="searchForm.accountStatus" placeholder="账目状态" filterable clearable>
          <Option
            v-for="(option, index) in ACCOUNT_STATUS_Select"
            :value="option.value"
            :key="index"
          >{{option.displayValue}}</Option>
        </Select>
    
</FormItem>
	
</i-col>

	<i-col span="12">
	<FormItem label="版本号"><Row>
	<i-col span="11">
	<FormItem prop="versionMin">
	<InputNumber v-model="searchForm.versionMin" placeholder="请输入开始版本号" style="width: 100%;"/>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="versionMax">
	<InputNumber v-model="searchForm.versionMax" placeholder="请输入结束版本号" style="width: 100%;"/>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="创建时间"><Row>
	<i-col span="11">
	<FormItem prop="createTimeMin">
	<DatePicker @on-change="searchForm.createTimeMin=$event" :value="searchForm.createTimeMin" placeholder="请输入开始创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="createTimeMax">
	<DatePicker @on-change="searchForm.createTimeMax=$event" :value="searchForm.createTimeMax" placeholder="请输入结束创建时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col>

	<i-col span="12">
	<FormItem label="更新时间"><Row>
	<i-col span="11">
	<FormItem prop="updateTimeMin">
	<DatePicker @on-change="searchForm.updateTimeMin=$event" :value="searchForm.updateTimeMin" placeholder="请输入开始更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
	<i-col span="2" style="text-align: center">-</i-col>
	<i-col span="11">
	<FormItem prop="updateTimeMax">
	<DatePicker @on-change="searchForm.updateTimeMax=$event" :value="searchForm.updateTimeMax" placeholder="请输入结束更新时间" type="datetime" format="yyyy-MM-dd HH:mm:ss" style="width: 100%;" clearable></DatePicker>
</FormItem>
</i-col>
</Row>
</FormItem>
</i-col><i-col span="12">
	<FormItem label="是否激活" prop="isActive">
	    
	        <Select v-model="searchForm.isActive" placeholder="是否激活" filterable clearable>
	          <Option
	            v-for="(option, index) in isActiveSelect"
	            :value="option.value"
	            :key="index"
	          >{{option.displayValue}}</Option>
	        </Select>
	    
	</FormItem>
</i-col>
</Row>

            </Form>
            <div slot="footer">
                <Button type="text" size="large" @click="resetForm">清空</Button>
                <Button type="text" size="large" @click="cancelModal">取消</Button>
                <Button type="primary" size="large" @click="searchOkModal" :loading="loading.search">查询</Button>
            </div>
        </Modal>
    </div>
</template>

<script>
	import * as utils from '@/api/utils-v2'
	import * as ResponseStatus from '@/api/response-status'
    export default {
        name: 'AccountDetailSearch',
        data() {
            return {
                modal: {
                    search: false
                },
				dataDictCodes: ['IS_ACTIVE', 'ACCOUNT_STATUS', 'INCOME_OUTGOING_TYPE', 'PAYMENT_TYPE','FUNDS_CHANGE_TYPE'],
				dataDictItems: {},
				isActiveSelect:[],
				ACCOUNT_STATUS_Select:[],
				INCOME_OUTGOING_TYPE_Select:[],
				PAYMENT_TYPE_Select:[],
				subTypeSelect:[],
                loading: {
                    search: false
                },
                urls: {
                    searchUrl: '/account-detail/admin/pager-cond'
                },
                searchForm: {
                    pageNo: 1,
                    pageSize: 10,
                    sortColumn: null,
                    sortOrder: null,
                    id: null,
idMin: null, 
idMax: null, 
transactionNo: null,
userId: null,
userIdMin: null, 
userIdMax: null, 
amount: null,
amountMin: null, 
amountMax: null,
integral: null,
integralMin: null, 
integralMax: null, 
type: null,
typeMin: null, 
typeMax: null, 
subType: null,
payType: null,
payTypeMin: null, 
payTypeMax: null, 
remark: null,
accountStatus: null,
accountStatusMin: null, 
accountStatusMax: null, 
version: null,
versionMin: null, 
versionMax: null, 
createTime: null,
createTimeMin: null, 
createTimeMax: null, 
updateTime: null,
updateTimeMin: null, 
updateTimeMax: null, 
isActive: null,
isActiveMin: null, 
isActiveMax: null, 

                }
            }
        },
        computed: {},
        mounted() {
			 utils.getDataDict(this.dataDictCodes).then(response => {
			  if (response) {
				this.dataDictItems = response
				utils.getSelectDictItems(this, 'IS_ACTIVE', 'isActive', 'isActiveSelect')
				utils.getSelectDictItems(this, 'ACCOUNT_STATUS', 'accountStatus', 'ACCOUNT_STATUS_Select')
				utils.getSelectDictItems(this, 'INCOME_OUTGOING_TYPE', 'type', 'INCOME_OUTGOING_TYPE_Select')
				utils.getSelectDictItems(this, 'PAYMENT_TYPE', 'payType', 'PAYMENT_TYPE_Select')
				utils.getSelectDictItems(this, 'FUNDS_CHANGE_TYPE', 'subType', 'subTypeSelect')
			  }
			}).catch(error => {
			  console.log(error)
			})
		},
        methods: {
            resetForm() {
				this.$refs.searchForm.resetFields()
            },
            cancelModal(modal) {
                this.modal.search = false
            },
            searchOkModal(modal) {
                this.modal.search = false
                this.$emit('searchTable', true)
            }
        }
    }
</script>

<style>
</style>
